package com.ntschy.common.valid.tel;


import cn.hutool.core.util.StrUtil;

import java.util.regex.Pattern;

public class TelValidationUtil {
    private static final Pattern PATTERN = Pattern.compile( "^(\\(\\d{3,4}\\)|\\d{3,4}-|\\s)?\\d{7,14}$");
    /**
     * 验证手机号
     */
    public static boolean isTel(String tel){
        if (StrUtil.isEmpty(tel)) {
            return false;
        } else {
            return PATTERN.matcher(tel).matches();
        }
    }
}

